<template>
  <div id="app">
    <router-view v-if="isRouterAlive" />
    <Tabbar></Tabbar>
  </div>
</template>

<script>
import Tabbar from "./components/Tabbar";
export default {
  components: {
    Tabbar
  },
  provide() {
    return {
      reload: this.reload
    };
  },
  data() {
    return {
      isRouterAlive: true
    };
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function() {
        this.isRouterAlive = true;
      });
    }
  },
  watch: {
    $route(to, from) {
      document.title = to.meta.navTitle || "友牧农场";
    }
  }
};
</script>

<style lang="scss">
/* 开关组件背景颜色 */
.van-switch--on {
  background-color: #31bc8d !important;
}
/* 选择地址取消确认按钮颜色 */
.van-picker__cancel,
.van-picker__confirm {
  color: #31bc8d !important;
}

.homedetail .van-radio__label {
  color: #969c9e !important;
}
.van-stepper__minus,
.van-stepper__plus {
  width: 30 !important;
  height: 30px !important;
  color: #31bc8d !important;
}
.van-stepper__input {
  width: 30 !important;
  height: 30px !important;
  background-color: #fff !important;
  color: #5d6164 !important;
}
.van-radio__icon--checked .van-icon {
  color: #fff !important;
  background-color: #31bc8d !important;
  border-color: #31bc8d !important;
}

.address .van-button {
  bottom: 12px !important;
  width: 343px;
  height: 51px;
  background: linear-gradient(
    94deg,
    rgba(49, 188, 141, 1) 0%,
    rgba(166, 226, 155, 1) 100%
  );
  border-radius: 26px;
  text-align: center;
  font-size: 18px;
  left: 50%;
  margin-left: -170px;
  box-shadow: 0 6px 10px #19884f66;
  margin-top: 20px;
  border: none;
}
.address .van-button:last-child {
  color: #31bc8d;
  background: #fff;
  border: 1px solid rgba(208, 207, 207, 1);
}
.van-dialog .van-dialog__confirm {
  color: #31bc8d;
}
</style>
